home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / Found / FWStream / SLObjReg.xh < prev    next >
Encoding:
Text File  |  1996-09-16  |  9.5 KB  |  401 lines  |  [TEXT/MPS ]

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: SLObjReg.xh.
  5.  * Generated using:
  6.  *     SOM Precompiler somipc: 2.18
  7.  *     SOM Emitter emitxh.dll: 2.33
  8.  */
  9.  
  10. /*
  11.  * 
  12.  *     File:        SLObjReg.idl
  13.  * 
  14.  *     Contains:    Interface for OObjectRegistry class
  15.  * 
  16.  *     Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  17.  * 
  18.  */
  19.  
  20.  
  21. #ifndef SOM_FW_OObjectRegistry_xh
  22. #define SOM_FW_OObjectRegistry_xh
  23.  
  24. class FW_OObjectRegistry;
  25.  
  26. #define FW_OObjectRegistry_MajorVersion 1
  27. #define FW_OObjectRegistry_MinorVersion 0
  28.  
  29. /*
  30.  * Passthru lines: File: "C.xh", "before"
  31.  */
  32.  
  33.  
  34. /* C++ SOM defs */
  35. #include <somcls.xh>
  36. #include <somcm.xh>
  37.  
  38. /* C++ parent defs */
  39. #ifndef SOM_SOMObject_xh
  40. #include <somobj.xh>
  41. #endif
  42.  
  43. #ifndef FW_OObjectRegistry_API
  44. #define FW_OObjectRegistry_API
  45. /*
  46.  * -- The Class API
  47.  */
  48.  
  49. /*
  50.  * Start of user-defined types:
  51.  */
  52. class SOMClass;
  53. class SOMObject;
  54. class FW_OObjectRegistry;
  55. class FW_OBasicObjectRegistry;
  56. typedef
  57. long  FW_ObjectRegistry_ID;
  58. #define FW_kNotInRegistry -1 /* -1 */
  59.  
  60. /*
  61.  * End of user-defined types.
  62.  */
  63.  
  64. #ifdef OLDIBMSOMAPISUPPORT
  65. #define FW_OObjectRegistryCClassData FW_OObjectRegistryClassData
  66. #define FW_OObjectRegistryNewClass(major,minor) somNewVersionedClassReference(FW_OObjectRegistry,major,minor)
  67. #endif
  68.  
  69. /* define xxxMetaClass macro to facilitate (cls ## MetaClass) */
  70. #define FW_OObjectRegistryMetaClass SOMClass
  71.  
  72. #if PRAGMA_ALIGN_SUPPORTED
  73. #  pragma options align=power
  74. #endif
  75.  
  76. /* The API to the FW_OObjectRegistry class object, and the methods it introduces. */
  77. SOMEXTERN struct FW_OObjectRegistryClassDataStructure {
  78. #ifdef OLDIBMSOMAPISUPPORT
  79.     SOMClass            *classObject;    /* always zero, use somNewClassReference instead */
  80. #else
  81.     long zero;
  82. #endif
  83.     somStaticClassInfo *sci;
  84.     somDToken        instanceDataToken;
  85.     long reserved [3];
  86.     somMToken somInit;
  87.     somMToken somUninit;
  88.     somMToken RegisterObject;
  89.     somMToken RegisterObjectAndID;
  90.     somMToken LookupByObject;
  91.     somMToken LookupByID;
  92. } SOMDLINK FW_OObjectRegistryClassData;
  93.  
  94. #if PRAGMA_ALIGN_SUPPORTED
  95. #  pragma options align=reset
  96. #endif
  97.  
  98. #if !defined(FW_OObjectRegistry_Class_Source) && !defined(SOM_Module_slobjreg_Source)
  99. #if PRAGMA_IMPORT_SUPPORTED
  100. #pragma import list FW_OObjectRegistryClassData
  101. #endif
  102. #endif
  103.  
  104.  
  105. /*
  106.  * -- Typedefs and inline method declarations for left path inherited methods
  107.  * -- are omitted because this compilation had -museinheritedmethods in effect
  108.  */
  109.  
  110.  
  111. /*
  112.  * -- Typedefs for FW_OObjectRegistry Method Procedures
  113.  */
  114. SOMEXTERN {
  115. typedef FW_ObjectRegistry_ID   (* SOMLINK somTD_FW_OObjectRegistry_RegisterObject)(FW_OObjectRegistry *somSelf, Environment *ev,
  116.         void* object);
  117. typedef void   (* SOMLINK somTD_FW_OObjectRegistry_RegisterObjectAndID)(FW_OObjectRegistry *somSelf, Environment *ev,
  118.         void* object,
  119.         FW_ObjectRegistry_ID id);
  120. typedef FW_ObjectRegistry_ID   (* SOMLINK somTD_FW_OObjectRegistry_LookupByObject)(FW_OObjectRegistry *somSelf, Environment *ev,
  121.         void* object);
  122. typedef void*   (* SOMLINK somTD_FW_OObjectRegistry_LookupByID)(FW_OObjectRegistry *somSelf, Environment *ev,
  123.         FW_ObjectRegistry_ID id);
  124. }
  125.  
  126. #endif /* FW_OObjectRegistry_API */
  127.  
  128.  
  129. /*
  130.  * -- This emitter treats Method Tokens as Thunks by default.
  131.  * -- Use the sc modifier "nothunks" to change this default
  132.  */
  133. #undef somresolve_
  134. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  135.  
  136. /*
  137.  * -- The C++ Wrapper Class for FW_OObjectRegistry
  138.  */
  139. class FW_OObjectRegistry : public SOMObject
  140. {
  141. public:
  142.  
  143. // FW_OObjectRegistry::new registers use of the class object, and then uses somNew
  144. // to allocate memory and load the object method table pointer. 
  145. void *operator new(size_t size)
  146. {
  147.     SOM_IgnoreWarning(size);
  148.     // Allocate memory using the default allocator for FW_OObjectRegistry, and
  149.     // clear mem & set method table pointer, call basic initialization
  150. #ifdef SOMCHKNULL
  151.     void * __somResult = (void *)
  152.       somNewObject(FW_OObjectRegistry);
  153.     SOMCHKNULL(__somResult);
  154.     return __somResult;
  155. #else
  156.     return (void*) somNewObject(FW_OObjectRegistry);
  157. #endif
  158. }
  159.  
  160. // FW_OObjectRegistry::delete uses the default deallocator for the object's class.
  161. void operator delete(void * obj)
  162. {
  163.     if (obj) {
  164.         SOM_Resolve(obj,SOMObject,somFree)
  165.            ( (SOMObject*) obj );
  166.     }
  167. }
  168.  
  169. /* method: RegisterObject */
  170. FW_ObjectRegistry_ID   RegisterObject(Environment *ev,
  171.         void* object)
  172. {
  173.    #ifdef SOMCHKEXCEPT
  174.    FW_ObjectRegistry_ID __somResult = 
  175.       SOM_ResolveD(this,FW_OObjectRegistry,FW_OObjectRegistry,RegisterObject)
  176.     (this,ev,object);
  177.       SOMCHKEXCEPT;
  178.    return __somResult;
  179. #else
  180.    return SOM_ResolveD(this,FW_OObjectRegistry,FW_OObjectRegistry,RegisterObject)
  181.     (this,ev,object);
  182. #endif
  183. }
  184.  
  185. /* method: RegisterObjectAndID */
  186. void   RegisterObjectAndID(Environment *ev,
  187.         void* object,
  188.         FW_ObjectRegistry_ID id)
  189. {
  190.    SOM_ResolveD(this,FW_OObjectRegistry,FW_OObjectRegistry,RegisterObjectAndID)
  191.     (this,ev,object,id);
  192. #ifdef SOMCHKEXCEPT
  193.       SOMCHKEXCEPT;
  194. #endif
  195. }
  196.  
  197. /* method: LookupByObject */
  198. FW_ObjectRegistry_ID   LookupByObject(Environment *ev,
  199.         void* object)
  200. {
  201.    #ifdef SOMCHKEXCEPT
  202.    FW_ObjectRegistry_ID __somResult = 
  203.       SOM_ResolveD(this,FW_OObjectRegistry,FW_OObjectRegistry,LookupByObject)
  204.     (this,ev,object);
  205.       SOMCHKEXCEPT;
  206.    return __somResult;
  207. #else
  208.    return SOM_ResolveD(this,FW_OObjectRegistry,FW_OObjectRegistry,LookupByObject)
  209.     (this,ev,object);
  210. #endif
  211. }
  212.  
  213. /* method: LookupByID */
  214. void*   LookupByID(Environment *ev,
  215.         FW_ObjectRegistry_ID id)
  216. {
  217.    #ifdef SOMCHKEXCEPT
  218.    void* __somResult = 
  219.       SOM_ResolveD(this,FW_OObjectRegistry,FW_OObjectRegistry,LookupByID)
  220.     (this,ev,id);
  221.       SOMCHKEXCEPT;
  222.    return __somResult;
  223. #else
  224.    return SOM_ResolveD(this,FW_OObjectRegistry,FW_OObjectRegistry,LookupByID)
  225.     (this,ev,id);
  226. #endif
  227. }
  228.  
  229. };   /* FW_OObjectRegistry */
  230.  
  231.  
  232.  
  233. #endif       /* SOM_FW_OObjectRegistry_xh */
  234.  
  235. #ifndef SOM_FW_OBasicObjectRegistry_xh
  236. #define SOM_FW_OBasicObjectRegistry_xh
  237.  
  238. class FW_OBasicObjectRegistry;
  239.  
  240. #define FW_OBasicObjectRegistry_MajorVersion 1
  241. #define FW_OBasicObjectRegistry_MinorVersion 0
  242.  
  243. /*
  244.  * Passthru lines: File: "C.xh", "before"
  245.  */
  246.  
  247.  
  248. /* C++ SOM defs */
  249. #include <somcls.xh>
  250. #include <somcm.xh>
  251.  
  252. /* C++ parent defs */
  253. #ifndef SOM_FW_OObjectRegistry_xh
  254. #include <SLObjReg.xh>
  255. #endif
  256.  
  257. #ifndef FW_OBasicObjectRegistry_API
  258. #define FW_OBasicObjectRegistry_API
  259. /*
  260.  * -- The Class API
  261.  */
  262.  
  263. /*
  264.  * Start of user-defined types:
  265.  */
  266.  
  267. /*
  268.  * -- Share exact same alignment between 68k & PowerPC.
  269.  * -- User to add padding to idl as desired for better alignment.
  270.  */
  271. #if powerc
  272. #  pragma options align=mac68k
  273. #endif
  274. typedef
  275. struct FW_OBasicObjectRegistry_SAssociation {
  276. FW_ObjectRegistry_ID fID;
  277.  
  278. /*
  279.  *  object id
  280.  */
  281. void*  fObject;
  282.  
  283. /*
  284.  *  object address
  285.  */
  286. } FW_OBasicObjectRegistry_SAssociation;
  287. #if powerc
  288. #  pragma options align=reset
  289. #endif
  290.  
  291. #ifndef SOM_DONT_USE_SHORT_NAMES
  292. #ifndef SOMTGD_SAssociation
  293.     #ifdef SAssociation
  294.         #undef SAssociation
  295.         #define SOMTGD_SAssociation 1
  296.     #else
  297.         #define SAssociation FW_OBasicObjectRegistry_SAssociation
  298.     #endif /* SAssociation */
  299. #endif /* SOMTGD_SAssociation */
  300. #endif /* SOM_DONT_USE_SHORT_NAMES */
  301.  
  302. /*
  303.  * End of user-defined types.
  304.  */
  305.  
  306. #ifdef OLDIBMSOMAPISUPPORT
  307. #define FW_OBasicObjectRegistryCClassData FW_OBasicObjectRegistryClassData
  308. #define FW_OBasicObjectRegistryNewClass(major,minor) somNewVersionedClassReference(FW_OBasicObjectRegistry,major,minor)
  309. #endif
  310.  
  311. /* define xxxMetaClass macro to facilitate (cls ## MetaClass) */
  312. #define FW_OBasicObjectRegistryMetaClass SOMClass
  313.  
  314. #if PRAGMA_ALIGN_SUPPORTED
  315. #  pragma options align=power
  316. #endif
  317.  
  318. /* The API to the FW_OBasicObjectRegistry class object, and the methods it introduces. */
  319. SOMEXTERN struct FW_OBasicObjectRegistryClassDataStructure {
  320. #ifdef OLDIBMSOMAPISUPPORT
  321.     SOMClass            *classObject;    /* always zero, use somNewClassReference instead */
  322. #else
  323.     long zero;
  324. #endif
  325.     somStaticClassInfo *sci;
  326.     somDToken        instanceDataToken;
  327.     long reserved [3];
  328. } SOMDLINK FW_OBasicObjectRegistryClassData;
  329.  
  330. #if PRAGMA_ALIGN_SUPPORTED
  331. #  pragma options align=reset
  332. #endif
  333.  
  334. #if !defined(FW_OBasicObjectRegistry_Class_Source) && !defined(SOM_Module_slobjreg_Source)
  335. #if PRAGMA_IMPORT_SUPPORTED
  336. #pragma import list FW_OBasicObjectRegistryClassData
  337. #endif
  338. #endif
  339.  
  340.  
  341. /*
  342.  * -- Typedefs and inline method declarations for left path inherited methods
  343.  * -- are omitted because this compilation had -museinheritedmethods in effect
  344.  */
  345.  
  346.  
  347. /*
  348.  * -- Typedefs for FW_OBasicObjectRegistry Method Procedures
  349.  */
  350. SOMEXTERN {
  351. }
  352.  
  353. #endif /* FW_OBasicObjectRegistry_API */
  354.  
  355.  
  356. /*
  357.  * -- This emitter treats Method Tokens as Thunks by default.
  358.  * -- Use the sc modifier "nothunks" to change this default
  359.  */
  360. #undef somresolve_
  361. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  362.  
  363. /*
  364.  * -- The C++ Wrapper Class for FW_OBasicObjectRegistry
  365.  */
  366. class FW_OBasicObjectRegistry : public FW_OObjectRegistry
  367. {
  368. public:
  369.  
  370. // FW_OBasicObjectRegistry::new registers use of the class object, and then uses somNew
  371. // to allocate memory and load the object method table pointer. 
  372. void *operator new(size_t size)
  373. {
  374.     SOM_IgnoreWarning(size);
  375.     // Allocate memory using the default allocator for FW_OBasicObjectRegistry, and
  376.     // clear mem & set method table pointer, call basic initialization
  377. #ifdef SOMCHKNULL
  378.     void * __somResult = (void *)
  379.       somNewObject(FW_OBasicObjectRegistry);
  380.     SOMCHKNULL(__somResult);
  381.     return __somResult;
  382. #else
  383.     return (void*) somNewObject(FW_OBasicObjectRegistry);
  384. #endif
  385. }
  386.  
  387. // FW_OBasicObjectRegistry::delete uses the default deallocator for the object's class.
  388. void operator delete(void * obj)
  389. {
  390.     if (obj) {
  391.         SOM_Resolve(obj,SOMObject,somFree)
  392.            ( (SOMObject*) obj );
  393.     }
  394. }
  395.  
  396. };   /* FW_OBasicObjectRegistry */
  397.  
  398.  
  399.  
  400. #endif       /* SOM_FW_OBasicObjectRegistry_xh */
  401.